﻿#ifndef CSCREENPROTECTORMAG_H
#define CSCREENPROTECTORMAG_H

#include <QObject>
#include <windows.h>
#include <QTimer>
#include <QWidget>
#include <QCursor>




class CScreenProtectorMag : public QObject
{
    Q_OBJECT
public:
    explicit CScreenProtectorMag(QObject *parent = nullptr);
    void Preview(bool bShowSecond, bool bShowDate, unsigned int nLockSpan, bool bRunOnStartup, const QString& sentence);

signals:
    void toDestroyScreenProtecter(int);


private:
    void    CreateScreenProtecter();
    void    CreatePreviewScreenProtecter();

    void    OnAnyInput();
    void    Initialize();

    QWidget* m_pParent;
    QTimer* m_timer;
    static  QCursor m_OriginCusor;
    bool    m_bHasShowScreenProtectDlg;
    DWORD   m_dwAppStartTime;
    DWORD   m_dwLastInputEventTime;
    bool    m_bInPreviewMode;

public slots:
    void OnTimerOut();

};

#endif // CSCREENPROTECTORMAG_H
